Electronic systems typically comprise a Central Processing Unit (CPU), that is the main processing element of the system, and a few peripheral elements that provide some other functionality to the system. Examples for peripheral elements are memories of various types (flash memories, magnetic disks, etc.), display means, communication means, and more.
Many peripheral elements require a controlling mechanism to manage and control their operation and their interaction with the CPU. For example, NAND-type flash memories are not straight-forward to use and to interface to and therefore require such a controlling mechanism. In some systems the CPU chip contains an integrated controller for providing such a controlling mechanism for a NAND-type flash memory. In other systems, the CPU does not contain an integrated controller for that purpose, and therefore the system designer must provide a controlling mechanism implemented separately from the CPU that interfaces with both the CPU and the NAND-type flash memory.
Many controllers are designed to support one specific interface for connection with the CPU. For example, there are many commercially available NAND-type flash memory controllers that support a USB interface for connection with the CPU. In order to operate such controller, the CPU must support a matching USB interface channel that is connected to the USB interface of the controller. As another example, there are many NAND-type flash memory controllers that support a Multi Media Card (MMC) interface for connection with the CPU. In order to operate such controller, the CPU must support a matching MMC interface channel that is connected to the MMC interface of the controller.
However, many controllers are configured to support multiple types of interfaces, e.g. USB and MMC interfaces, for connection with the CPU. Configuring such controllers provide the system designer with extra flexibility, as he can choose which interface to use according to the types of interface channels available in the CPU or according to desired characteristics of the interface, such as speed of operation.
Note that typically only a single interface is operative at any given system, even though the same controller is configured to support different types of interface channels when connected to different systems. This is a great advantage from a logistic point of view, since a single stored Integrated Circuit (IC) is provided to support a plurality of interface channels when connected to many different systems.
However, as those multi-interface controllers can support multiple operation modes (herein we refer to the use of each interface as a “mode”), the desired interface channel must be configured in the system it is currently installed in during system power-up. If this is not properly done, a controller may operate in a USB-interface mode while the CPU only supports the MMC interface, with the result that the system will fail to operate correctly.
Several approaches known in the art are provided for configuring multi-interface controllers, trying to overcome this problem. Such approaches include configuration pins and non-volatile memory configuration bits:                A. Configuration pins—The IC controller has one or more pins that are used during system power-up for selecting the desired interface channel. For example, in a controller that supports the two USB and MMC interface channels, a single pin is assigned for interface channel selection. At power-up, the internal circuitry within the controller measures the input voltage level set at this pin. If it is at one state (e.g. logical “0”)—the USB mode is selected, and if it is at another state (e.g. logical “1”)—the MMC mode is selected. In case there are more than two modes to select from, then more than one pin is used.        It should be noted that such configuration pins are not necessarily used only for the configuration function of selecting the desired interface. As the interface decision has to be taken only at system power-up time, the configuration pins may later be used for other functionalities during the controller's normal operation.        In order to configure a controller by implementing configuration pins, the system designer should make sure that required voltage levels are applied to the configuration pins during system power-up. This can be done by providing a fixed wiring on the Printed Circuit Board—PCB (in case the configuration pins are not also used for another purpose), or by implementing an electronic circuitry that applies the required voltage levels to the configuration pins at system power-up but can be later on disconnected from the configuration pins.        
However, the above configuration method of configuration pins has its disadvantages. The main disadvantage that arises when applying the configuration pins method is that the selection of the configuration mode is completely in the hands of the user using the controller and is not controlled by the controller's manufacturer. It is the designer of the system using the controller that decides on the PCB wiring and therefore on the mode in which the controller operates.
This is not desirable for the controller's manufacturer because it limits his options, such as offering different interfaces at different prices, etc. For example, if competing USB controllers are of low cost in the market while competing MMC controllers are expensive, it would be advantageous for the manufacturer to charge customers more for getting support via the MMC mode than via the USB mode. But by applying the configuration pins method this is not possible, since all controllers are configured “without an identity”, and only the customer configure the controller's operation mode.
Another example to the limitations of this method occurs when the use of one of the interfaces requires the payment of a licensing fee. In such a case, a customer which elects to not pay the fee and not get the license is not blocked from violating the manufacturer's rights by configuring the controller to use the non-licensed mode.                B. Non-volatile memory configuration bits—The desired configuration mode is coded into a non-volatile memory that is read by the controller at system power-up time. For example, if the controller controls a NAND-type flash memory, one can assign the first byte of the first page of the first block of the flash memory address space to contain the configuration bits.        For example, in a controller that supports the two modes of USB and MMC, a single bit is assigned for mode selection. At system power-up an internal circuitry within the controller reads the value stored in the configuration bit. If it is at one state (e.g. logical. “0”)—USB mode is selected, and if it is at another state (e.g. logical “1”)—the MMC mode is selected. In case there are more than two modes to select from, then more than one bit is used.        In order to configure a controller by implementing non-volatile memory configuration bits, the system designer should make sure that required data is stored in the configuration bits. This is typically achieved by programming the data into the flash memory during the manufacturing process of the system.        As fresh and unused flash memory cells typically have a logical “1” stored in every bit position, the default configuration in the above example supports the MMC interface. Therefore, if the system designer wants the controller to support the USB mode, he can program the flash memory at an earlier manufacturing stage (before it is assembled with the controller). another way is to temporarily use an MMC channel for accessing the controller and instruct it to write the configuration bits into the flash memory, and then shut down the system and power it up again, so that the controller will then wake up to support the USB mode.        
According to the non-volatile memory configuration bits method, the configuration bits are accessible only to the controller's manufacturer and not to the customer (e.g. when the controller and the flash memory are sold already assembled together as one unit). Therefore, the manufacturer retains complete control of the configuration mode. In other words, if the manufacturer configured the configuration bits for supporting a certain interface, he is guaranteed that the customer cannot change this interface. Therefore, different pricing for different modes, or the blocking of a non-licensed mode are both possible.
However, such policy results in a loss of manufacturing flexibility. Each interface mode becomes a separate item, with its own part number and stock to be kept. If the manufacturer still wants some customers (or his manufacturing facility) to enjoy the flexibility provided by the configuration pins method, this is not available any more.
Thus, it would be highly advantageous to provide a method and system for flexibly configuring a flash memory controller, such that the advantages of both prior art methods mentioned above are retained at the same time.